wpt_tmp = route_find_waypt_by_name(routehead[goog_segroute], goog_segname);
if (wpt_tmp) {
#if NEW_STRINGS
+ wpt_tmp->shortname = QString();
#else
xfree(wpt_tmp->shortname);
#endif
wpt_tmp->latitude = lat / 100000.0;
wpt_tmp->longitude = lon / 100000.0;
wpt_tmp->route_priority=level;
- wpt_tmp->shortname = (char*) xmalloc(7);
+// NEW_STRINGS FIXME(robertlipe): this is broken somehow there should be no need
+// to overallocate like this, but it's needed ot get an1 to not scribble
+// on itself.
+ wpt_tmp->shortname = (char*) xmalloc(7000);
#if NEW_STRINGS
wpt_tmp->shortname = QString().sprintf( "\\%5.5x", serial++);
#else
gbfprintf(file_out, "%s\r\n", str);
}
xfree(rd);
+ rd = NULL;
#else
if (track && track->rte_desc && strncmp(track->rte_desc, HDRMAGIC, strlen(HDRMAGIC)) == 0) {
for (str = strtok(CSTRc(track->rte_desc) + strlen(HDRMAGIC) + strlen(HDRDELIM), HDRDELIM);
// its description as the pilot's name in the header.
str = dflt_str;
#if NEW_STRINGS
+// FIXME: This almost certainly introduces a memory leak because str
+// is a c string that's used for totally too many things. Just let it
+// leak for now. 2013-12-31 robertl
if (NULL != (wpt = find_waypt_by_name("PILOT")) && !wpt->description.isEmpty()) {
+ str = xstrdup(CSTRc(wpt->description));
#else
if (NULL != (wpt = find_waypt_by_name("PILOT")) && wpt->description) {
-#endif
str = CSTRc(wpt->description);
+#endif
}
gbfprintf(file_out, "HFPLTPILOT:%s\r\n", str);
}